using UnityEngine;
using System.Collections;

public class ReduceDrawCalls : MonoBehaviour {

	void Start () 
    {   

        Color currentColor = renderer.material.color;
        renderer.material.shader = Shader.Find("Cube Colors/Draw Call");

        renderer.material = MaterialManager._instance.getMaterial();

		Mesh mesh = gameObject.GetComponent<MeshFilter>().mesh;
		Vector3[] vertices = mesh.vertices;
        Color[] color = new Color[vertices.Length];

        for (int i = 0; i < vertices.Length; i++)
        {
            color[i] = currentColor;
        }

        mesh.colors = color;

	}

}
